#include <stdlib.h>
#include "my_strdup.h"

#ifndef strdup
char* strdup(char* str) {
  char* dup = (char*)calloc(strlen(str) * sizeof(char), 0);
  strncpy(dup, str, len);
  return dup;
}

char* strndup(char* str, int len) {
  char* dup = (char*)calloc((len + 1) * sizeof(char), 0);
  strncpy(dup, str, len);
  return dup;
}
#endif
